package DBClasses;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Michael
 */

import java.sql.*;
        
public class GetConnection 
{
    public GetConnection()
    {
        
    }
    
    public Connection getConnection()
    {
        Connection conn = null;
        java.util.Properties connectionProps = new java.util.Properties();
        
        connectionProps.put("user", "mmandrus");
        connectionProps.put("password", "106719602");

        
        try 
        {
            Class.forName("com.mysql.jdbc.Driver").newInstance();
            conn = DriverManager.getConnection("jdbc:mysql://mysql1.cs.stonybrook.edu/mmandrus", connectionProps);
            //conn = DriverManager.getConnection("jdbc:mysql://localhost/mmandrus", connectionProps);
            conn.setAutoCommit(false);
        } 

        catch (Exception e) 
        {
                e.printStackTrace();
        }
        
        return conn;

    }
}
